package com;

import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport {
	private String account;
	private String password;
	
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String execute() {
		System.out.println("execute() is called!");
		return "success";
	}
    public void validate() {
    	System.out.println("validate() is called!");
        if (account == null || account.equals("")) {
        	System.out.println("xx");
        	this.addFieldError("account","请输入您的用户名！");
       	}
        if (password == null || password.equals("")) {
       	this.addFieldError("password", "请输入您的密码！");}
  }
}
